package com.Lyoto.NetNotify.Exceptions;

import com.Lyoto.NetNotify.Constraint.ExceptionEnum;
import lombok.Getter;

/**
 * @author Lyoto
 * @Description
 * @Date 2022-09-20 9:23
 * @Version
 **/
@Getter
public class NetErrorException extends RuntimeException{
    private long errorCode;
    
    private String msg;
    
    public NetErrorException(ExceptionEnum exceptionEnum) {
        super(exceptionEnum.getMsg());
        this.errorCode = exceptionEnum.getErrorCode();
        this.msg = exceptionEnum.getMsg();
    }

    public NetErrorException setErrorCode(long errorCode) {
        this.errorCode = errorCode;
        return this;
    }

    public NetErrorException setMsg(String msg) {
        this.msg = msg;
        return this;
    }
    
}
